#include "Camera.h"
#include "gl/gl.h"
#include "gl/glu.h"
#include "Vec3.h"
#include "Vec4.h"

Camera::Camera(){
    //perspective={60.0f,1.0f,0.1f,100.0f};
    perspective= Vec4(60.0f,1.0f,0.1f,100.0f);
    //eye={0.0f,0.0f,10.0f};
    eye[0]=0.0f;
    eye[1]=0.0f;
    eye[2]=10.0f;
    //center={0.0f,0.0f,0.0f};
    center[0]=0.0f;
    center[1]=0.0f;
    center[2]=0.0f;
    //up = {0.0f,1.0f,0.0f};
    up[0]=0.0f;
    up[1]=1.0f;
    up[2]=0.0f;
    //color
    color[0]=0.0f;
    color[1]=1.0f;
    color[2]=0.0f;
    //position
    pos= Vec3(0.0f,0.0f,-5.0f);
    //activate
    active=false;
    rot = Vec4(0.0f, 0.0f, 1.0f, 0.0f);
    
}   
void Camera::render(float timeElapsed){
     
    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen 
    //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); // display all mesh lines of the sphere
     
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(perspective[0],perspective[1],perspective[2],perspective[3]);
    
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    gluLookAt(eye[0], eye[1], eye[2], 
              center[0], center[1], center[2], 
              up[0], up[1], up[2]);
    glTranslatef(pos[0],pos[1],pos[2]);
    glRotatef (rot[0],rot[1],rot[2],rot[3]);

    glColor3f(color[0], color[1], color[2]);  // green 
    
}   
Camera::~Camera(){
}   
    
    
    
    
    
    
    
